﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace nanoCMS.Core {
	public static class RequestItems {
		public static string Redirect {
			get { return System.Web.HttpContext.Current.Items.Contains("Redirect") ? System.Web.HttpContext.Current.Items["Redirect"].ToString() : null; }

			set {
				if (!System.Web.HttpContext.Current.Items.Contains("Redirect"))
					System.Web.HttpContext.Current.Items.Add("Redirect", value);
				System.Web.HttpContext.Current.Items["Redirect"] = value;
			}
		}

		public static int TenantID {
			get { return System.Web.HttpContext.Current.Items.Contains("TenantID") ? Convert.ToInt32(System.Web.HttpContext.Current.Items["TenantID"]) : -1; }
			set {
				if (!System.Web.HttpContext.Current.Items.Contains("TenantID"))
					System.Web.HttpContext.Current.Items.Add("TenantID", value);
				System.Web.HttpContext.Current.Items["TenantID"] = value;
			}
		}

		public static int TenantLangID {
			get {
				return System.Web.HttpContext.Current.Items.Contains("TenantLangID")
							? Convert.ToInt32(System.Web.HttpContext.Current.Items["TenantLangID"])
							: -1;
			}

			set {
				if (!System.Web.HttpContext.Current.Items.Contains("TenantLangID"))
					System.Web.HttpContext.Current.Items.Add("TenantLangID", value);
				System.Web.HttpContext.Current.Items["TenantLangID"] = value;
			}
		}

		public static List<string> SuccessMessages { get; set; }

	}
}
